﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CWB.Common.Logging;
using CWB.Web.MVC.BaseController;
using CWB.Common.Constant;
using CWB.Web.MVC.Filters;
using CWB.Web.Models.Configuration;

namespace CWB.WebSite.Controllers
{
    public class ReportController : MultiCultureBaseController
    {
        private static readonly ISysLog Log = SysLog.GetLogger(typeof(AgentController));

        public ReportController(LanguageInfo languageInfo)
            : base(languageInfo)
        {
            ControllerPermision = Permission.Private;
        }

        [PermissionFilterAttvibute(loginType = LoginType.Agent)]
        public ActionResult GeneralReport(int? id)
        {
            int iUplinesn = Convert.ToInt16(id);
            if (iUplinesn == 0 && sessionData.trading.loginType == LoginType.Agent)
            {
                iUplinesn = sessionData.trading.sn;
            }
            ViewData["uplinesn"] = iUplinesn;
            return View();
        }

        [PermissionFilterAttvibute(loginType = LoginType.Agent)]
        public ActionResult RequestReport(int? id)
        {
            int iUplinesn = Convert.ToInt16(id);
            if (iUplinesn == 0 && sessionData.trading.loginType == LoginType.Agent)
            {
                iUplinesn = sessionData.trading.sn;
            }
            ViewData["uplinesn"] = iUplinesn;
            return View();
        }
    }
}
